const HtmlWebpackPlugin = require('html-webpack-plugin')//生成html
const path = require('path') 
module.exports = {
    entry: './index.js', //单入口
    output: {
        filename: 'js/index.[contenthash].js',//增加哈希值 解决服务器缓存问题
        path: path.resolve(__dirname, 'dist')
    },
    optimization: {//打包第三方库
        splitChunks: {
            chunks: 'all'
        }
    },
    mode: 'production'//生成环境会自动压缩js代码
}